//
//  CommonConfig.swift
//  ZHLEEBlog_swift_pro
//
//  Created by ZHLEEBlander on 15/10/11.
//  Copyright © 2015年 ZHLEEBlander. All rights reserved.
//

import Foundation
import UIKit

let ScreenW = UIScreen.mainScreen().bounds.size.width
let ScreenH = UIScreen.mainScreen().bounds.size.height

func printLog<T>(message: T,error: Bool = false,fileName: String = __FILE__, line: Int = __LINE__, methodName: String = __FUNCTION__){
    
    if error {
        print("\((fileName as NSString).lastPathComponent)[\(line)], \(methodName): \(message)")
    }else{
        
        #if DEBUG
            print("\((fileName as NSString).lastPathComponent)[\(line)], \(methodName): \(message)")
        #endif
    }
}

func RGB(r r: CGFloat, g: CGFloat, b: CGFloat)->UIColor{

    return UIColor(red: r/255, green: g/255, blue: b/255, alpha: 1)
}

func RandomColor() -> UIColor{

    return RGB(r: CGFloat(random() % 255), g: CGFloat(random() % 255), b: CGFloat(random() % 255))
}